/* 现代化UI样式 - 拼团项目 */

/* CSS变量定义 */
:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #ff6b6b;
    --accent-color: #ff8e53;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #bdc3c7;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 轮播图样式 */
.swiper-container {
    width: 100%;
    height: 320px;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    background: var(--bg-primary);
}

.swiper-wrapper {
    height: 100%;
    display: flex;
    transition: transform 0.4s var(--transition);
}

.swiper-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    overflow: hidden;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition);
}

.swiper-slide:hover img {
    transform: scale(1.08);
}

.swiper-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.swiper-pagination-bullet,
.swiper-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
    cursor: pointer;
}

.swiper-pagination-bullet-active,
.swiper-dot.active {
    background: var(--bg-primary);
    width: 24px;
    border-radius: 4px;
}

/* 商品信息卡片 */
.product-info {
    background: var(--bg-primary);
    margin: -40px 20px 20px;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.product-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promotion-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.promotion-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 12px;
    font-weight: 500;
}

/* 拼团列表 */
.group-list {
    margin: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.group-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.2);
}

.empty-tips {
    text-align: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    color: var(--bg-primary);
    font-size: 16px;
    font-weight: 600;
    border: none;
}

.user-info {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.group-status {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.countdown {
    color: var(--error-color);
    font-weight: 700;
    font-size: 15px;
    background: rgba(231, 76, 60, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
}

.right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.group-btn {
    background: var(--bg-gradient);
    color: var(--bg-primary);
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.group-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.group-btn:hover::before {
    left: 100%;
}

.group-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}

.group-btn:active {
    transform: translateY(0);
}

/* 底部操作栏 */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.action-btn {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.buy-alone {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.buy-alone:hover {
    background: #e9ecef;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.group-buy {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--bg-primary);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
    font-weight: 700;
}

.group-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 107, 0.4);
}

.order-list-btn {
    background: var(--primary-color);
    color: var(--bg-primary);
    font-size: 13px;
    font-weight: 600;
}

.order-list-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.test-callback-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: var(--bg-primary);
    font-size: 13px;
    font-weight: 600;
}

.test-callback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(155, 89, 182, 0.3);
}

/* 空白区域 */
.area {
    height: 120px;
}

/* 支付弹窗 */
.payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.payment-modal {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.payment-modal h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-modal p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.copyable {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
    transition: var(--transition);
}

.copyable:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.modal-buttons {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.confirm-btn, .cancel-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.confirm-btn {
    background: var(--bg-gradient);
    color: var(--bg-primary);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
}

.cancel-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.cancel-btn:hover {
    background: #e9ecef;
    border-color: rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-info {
        margin: -30px 15px 15px;
        padding: 24px;
    }
    
    .product-title {
        font-size: 22px;
    }
    
    .group-item {
        padding: 20px;
        margin-bottom: 12px;
    }
    
    .action-bar {
        padding: 16px;
        gap: 8px;
    }
    
    .action-btn {
        font-size: 14px;
        padding: 14px 16px;
        min-height: 48px;
    }
    
    .payment-modal {
        padding: 30px 20px;
    }
    
    .payment-modal h3 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .swiper-container {
        height: 280px;
    }
    
    .product-info {
        margin: -25px 12px 12px;
        padding: 20px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .action-bar {
        padding: 12px;
        flex-wrap: wrap;
    }
    
    .action-btn {
        font-size: 13px;
        min-height: 44px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-secondary);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}